home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / pcmagazi / utility / chain / demo.pas < prev   
Pascal/Delphi Source File  |  1987-11-17  |  794b  |  28 lines

  1. {
  2.  This simple program demonstrates the use of the CHAIN unit.
  3.  After compiling DEMO, call it with two command line parameters.
  4.  The first parameter is the full name of the program to execute,
  5.  including extension and path, if any. The second parameter is any
  6.  command line to pass on to the program.
  7.  
  8.  An interesting case to try is:
  9.    DEMO DEMO.EXE DEMO.EXE
  10. }
  11. program demo;
  12. uses
  13.   chain;
  14. var
  15.   status:word;
  16. begin
  17.   writeln('Turbo 4.0 Chaining Demonstration, by TurboPower Software');
  18.   if paramcount < 1 then begin
  19.     writeln('Usage: DEMO ProgramToChainTo CommandLineToPass');
  20.     halt;
  21.   end;
  22.   status:=chain4(paramstr(1),paramstr(2));
  23.   case status of
  24.     2:writeln('file "',paramstr(1),'" not found');
  25.     30:writeln('error reading ',paramstr(1));
  26.   end;
  27. end.
  28.